<?php /*a:2:{s:33:"./themes/install/index\step2.html";i:1521154324;s:31:"./themes/install/base\base.html";i:1521154324;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo isset($metaTitle) ? htmlentities($metaTitle) : 'startbbs'; ?>-安装</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="/public/static/common/js/layui/css/layui.css">
    <link rel="stylesheet" href="/public/static/install/css/main.css" media="all">
    
</head>
<body class="layui-layout-body layui-layout">
<header class="layui-header header">
    <div class="layui-main">
        <a class="logo" href="#"><img src="/public/static/default/images/logo.png" alt="startbbs"></a>
        <ul class="layui-nav ml200 pl0" >
            <li class="layui-nav-item <?php echo isset($step) ? htmlentities($step) : ''; ?>">
                <a href="javascript:void(0);">安装系统</a>
            </li>
            <li class="layui-nav-item <?php echo isset($step1) ? htmlentities($step1) : ''; ?>">
                <a href="javascript:void(0);">环境检测</a>
            </li>
            <li class="layui-nav-item <?php echo isset($step2) ? htmlentities($step2) : ''; ?>">
                <a href="javascript:void(0);">创建数据库</a>
            </li>
            <li class="layui-nav-item <?php echo isset($step3) ? htmlentities($step3) : ''; ?>">
                <a href="javascript:void(0);"><?php if(Session::get('update','install') == '1'): ?>升级<?php else: ?>安装<?php endif; ?></a>
            </li>
            <li class="layui-nav-item <?php echo isset($step4) ? htmlentities($step4) : ''; ?>">
                <a href="javascript:void(0);">完成</a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="http://www.startbbs.com/">StartBBS官网</a>
            </li>
        </ul>
    </div>
</header>
<div class="layui-main">
    
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>创建数据库</legend>
</fieldset>
<form class="layui-form" action="<?php echo Url::build('Index/step2'); ?>" method="post" target="_self">
    数据库信息
    <hr class="layui-bg-green">
    <div class="layui-form-item">
        <label class="layui-form-label">数据库类型</label>
        <div class="layui-input-inline">
            <select name="db[0]" lay-verify="required">
                <option>mysql</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">服务器地址</label>
        <div class="layui-input-inline">
            <input type="text" name="db[1]" lay-verify="required" value="127.0.0.1" placeholder="请输入IP"
                   class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">数据库服务器,默认为127.0.0.1</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数据库名字</label>
        <div class="layui-input-inline">
            <input type="text" name="db[2]" lay-verify="required" placeholder="请输入数据库名字" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">数据库名字</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数据库帐号</label>
        <div class="layui-input-inline">
            <input type="text" name="db[3]" lay-verify="required" value="root" placeholder="请输入数据库用户名" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">数据库用户名</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数据库密码</label>
        <div class="layui-input-inline">
            <input type="password" name="db[4]" lay-verify="required" placeholder="请输入数据库密码" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">数据库密码</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数据库端口</label>
        <div class="layui-input-inline">
            <input type="text" name="db[5]" lay-verify="number" value="3306" placeholder="请输入端口" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">数据库服务连接端口</div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">数据表前缀</label>
        <div class="layui-input-inline">
            <input type="text" name="db[6]" lay-verify="required" value="stb_" placeholder="请输入数据表前缀"
                   class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">同一个数据库运行多个系统时请修改为不同的前缀</div>
    </div>
    创始人帐号信息
    <hr class="layui-bg-green">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" name="admin[0]" lay-verify="required" value="admin" placeholder="请输入用户名"
                   class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">默认为超级管理员</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="password" name="admin[1]" lay-verify="required|length" placeholder="请输入密码"
                   class="layui-input pass">
        </div>
        <div class="layui-form-mid layui-word-aux">密码,至少6位字符以上</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-inline">
            <input type="password" name="admin[2]" lay-verify="required|repassword" placeholder="请输入确认密码" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">确认密码</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="admin[3]" lay-verify="required|email" placeholder="请输入邮箱" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请填写正确的邮箱便于收取提醒邮件</div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="install">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

</div>

<div class="layui-footer footer">
    <div class="layui-main">
        <p>Copyright <strong><a href="https://www.startbbs.com">Startbbs.com</a></strong> &copy; 2018</p>
    </div>
</div>


<script type="text/javascript" src="/public/static/common/layui.js" charset="utf-8"></script>
<script src="/public/static/common/js/layui/layui.all.js"></script>
<script src="/public/static/common/js/global.js"></script>


<script type="text/javascript">
    layui.use(['jquery','form'], function () {
        layui.form.verify({
            length: function (value) {
                if (value.length < 6) {
                    return "密码必须6个字符以上";
                }
            },
            repassword: function (value) {
                if (value !== layui.$('.pass').val()) {
                    return '两次密码不一致';
                }
            }
        });
        //监听提交
        layui.form.on('submit(install)', function () {
            layui.$('form').submit();
            return false;
        });
    });
</script>

</body>
</html>